import java.util.Arrays;

/**
 * @author wangj881
 * @date 2024-12-26 10:08
 */
public class L283_3 {

    public static void main(String[] args) {
        int[] nums = {1,0,1};
        new Solution().moveZeroes(nums);
    }

    static class Solution {
        public void moveZeroes(int[] nums) {
            if (nums.length < 2) {
                return;
            }
            int left = 0;
            int right = 0;
            while (right < nums.length) {
                if (nums[left] == 0) {
                    if (nums[right] == 0) {
                        right++;
                        continue;
                    }
                    nums[left] = nums[right];
                    nums[right] = 0;
                }
                left++;
                right++;
                System.out.println(Arrays.toString(nums));
            }
        }
    }
}
